#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "config.hpp"
#include <QApplication>
#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QVBoxLayout>
#include <QImage>
#include <QCloseEvent>
#include <QLineEdit>


class MainWindow : public QWidget {
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);

signals:
    void frame_ready(Mat& frame);

protected:
    void closeEvent(QCloseEvent *event) override;

private slots:
    void resetCamera();
    void cancelReset();
    void startThread();
    void suspendThread();
    void rerunThread();
    
private:
    QLabel *label;
    QLabel *video_label;
    QLineEdit *interval_field;
    QLineEdit *duration_field;
    void updateLabel();
    void updateFrame(Mat& frame);
};

#endif // MAINWINDOW_H
